package org.learn.tankgame3;

import javax.swing.*;

public class QjjTankGame03 extends JFrame {

    //定义一个MyPanel
    MyPanel mp = null;
    public static void main(String[] args) {
        QjjTankGame03 qjjTankGame01 = new QjjTankGame03();
    }
    public QjjTankGame03(){
        //初始化面板
        mp = new MyPanel();
        //将mp放到Thread ，并启动；
        Thread thread = new Thread(mp);
        thread.start();

        //把面板放入画框(窗口)
        this.add(mp);
        //设置窗口大小
        this.setSize(1000,750);
        this.addKeyListener(mp);//监听mp键盘事件
        this.setVisible(true);//可视
        //点击窗口的红叉程序完全退出
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }
}
